package com.yonyou.crm.base.product.rmimpl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.yonyou.crm.base.product.entity.ProductVO;
import com.yonyou.crm.base.product.rmitf.IProductRmService;
import com.yonyou.crm.base.product.service.ProductBizServiceImpl;
import com.yonyou.crm.base.product.service.ProductOrgBizServiceImpl;
import com.yonyou.crm.common.page.entity.Page;

@Service("productService")
public class ProductRmServiceImpl implements IProductRmService {

	@Autowired
	private ProductBizServiceImpl service;
	@Autowired
	private ProductOrgBizServiceImpl poService;
	
	@Override
	public Page<ProductVO> page(Page<ProductVO> page, Map<String, Object> paraMap) {
		return service.getPage(page, paraMap);
	}
	
	@Override
	public ProductVO detail(Long id) {
		return service.getDetail(id);
	}

	@Override
	public ProductVO insert(ProductVO vo) {
		return service.saveVO(vo);
	}
	
	@Override
	public ProductVO update(ProductVO vo) {
		return service.updateVO(vo);
	}

	@Override
	public String batchDelete(String[] ids) {
		return service.batchDelete(ids);
	}

	@Override
	public Page<ProductVO> batchUpdateEnableState(String[] ids,
			Integer enableState, Page<ProductVO> page,
			Map<String, Object> paraMap) {
		service.batchUpdateEnableState(ids, enableState);
		return service.getPage(page, paraMap);
	}

	@Override
	public int insertProductFollow(Long id) {
		return service.saveProductFollow(id);
	}

	@Override
	public int deleteProductFollow(Long id) {
		return service.deleteProductFollow(id);
	}
	
	@Override
	public Page<ProductVO> getRefPage(Page<ProductVO> page, Map<String, Object> paraMap) {
		return service.getRefPage(page, paraMap);
	}
	
	@Override
	public List<ProductVO> getRefList(Map<String, Object> paraMap) {
		return service.getRefList(paraMap);
	}
	
	@Override
	public boolean isCitedByBObj(Long id) {
		return service.isCitedByBObj(id);
	}
	
	@Override
	public void allocateOrg(Long productId, String[] orgIds) {
		poService.allocateOrg(productId, orgIds);
	}

}
